Public Class SQLParseForeignKey
    Inherits SQLParser

    Protected Overrides Function MyParserState() As SQLParserState
        Return SQLParserState.SQLParseForeignKey
    End Function

    Protected Friend Overrides Sub ParseCommands(ByVal Commands() As String, ByRef tables As TableList)
        If Commands.Length > 9 AndAlso Commands(8).ToLower = "foreign" Then
            Dim col As Column = tables.ActiveTable.Item(Commands(Commands.Length - 1)) 'set active column by referencing it by name.
            Me.SetParserState(SQLParserState.SQLParseFKTable)
        Else
            Dim col As Column = tables.ActiveTable.Item(Commands(0)) 'set active column by referencing it by name.
            Me.SetParserState(SQLParserState.SQLParseFKTable)
        End If
    End Sub
End Class
